package com.keensense.vcm.model;

import java.util.List;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

import com.keensense.vcm.model.enums.AlarmLevelEnum;
import com.keensense.vcm.model.enums.AlarmTypeEnum;

/**
 * @author lanjian
 * @date 2020/5/27 5:06 下午
 */
@XmlRootElement(name = "message")
public class SearchAlarmRequest {

    private SearchAlarmRequest() {}

    public SearchAlarmRequest(Long startTime, Long endTime, int rule, Page page) {
        this.startTime = startTime;
        this.endTime = endTime;
        this.rule = rule;
        this.page = page;
    }

    @XmlElement(name = "start-time")
    private Long startTime;

    @XmlElement(name = "end-time")
    private Long endTime;

    @XmlElement
    private Integer rule;

    @XmlElement(name = "alarmListType")
    private AlarmTypeEnum alarmListType;

    @XmlElement(name = "alarm-level")
    private AlarmLevelEnum alarmLevel;

    @XmlElementWrapper(name = "suspectIdList")
    @XmlElement(name = "id")
    private List<String> suspectIdList;

    @XmlElementWrapper(name = "cameras")
    @XmlElement(name = "camera-id")
    private List<String> cameras;

    @XmlElement(name = "pnr")
    private String pnr;

    @XmlElement(name = "sourceType")
    private Integer sourceType;

    @XmlElement
    private Page page;

    @XmlTransient
    public Long getStartTime() {
        return startTime;
    }

    public void setStartTime(Long startTime) {
        this.startTime = startTime;
    }

    @XmlTransient
    public Long getEndTime() {
        return endTime;
    }

    public void setEndTime(Long endTime) {
        this.endTime = endTime;
    }

    @XmlTransient
    public Integer getRule() {
        return rule;
    }

    public void setRule(Integer rule) {
        this.rule = rule;
    }

    @XmlTransient
    public AlarmTypeEnum getAlarmListType() {
        return alarmListType;
    }

    public void setAlarmListType(AlarmTypeEnum alarmListType) {
        this.alarmListType = alarmListType;
    }

    @XmlTransient
    public AlarmLevelEnum getAlarmLevel() {
        return alarmLevel;
    }

    public void setAlarmLevel(AlarmLevelEnum alarmLevel) {
        this.alarmLevel = alarmLevel;
    }

    @XmlTransient
    public List<String> getSuspectIdList() {
        return suspectIdList;
    }

    public void setSuspectIdList(List<String> suspectIdList) {
        this.suspectIdList = suspectIdList;
    }

    @XmlTransient
    public List<String> getCameras() {
        return cameras;
    }

    public void setCameras(List<String> cameras) {
        this.cameras = cameras;
    }

    @XmlTransient
    public Page getPage() {
        return page;
    }

    public void setPage(Page page) {
        this.page = page;
    }

    @XmlTransient
    public String getPnr() {
        return pnr;
    }

    public void setPnr(String pnr) {
        this.pnr = pnr;
    }

    @XmlTransient
    public Integer getSourceType() {
        return sourceType;
    }

    public void setSourceType(Integer sourceType) {
        this.sourceType = sourceType;
    }

    public static class Page {

        public Page(int no, int pageSize) {
            this.no = no;
            this.pageSize = pageSize;
        }

        @XmlElement(name = "no")
        private Integer no;

        @XmlElement(name = "pageSize")
        private Integer pageSize;

        @XmlTransient
        public int getNo() {
            return no;
        }

        public void setNo(int no) {
            this.no = no;
        }

        @XmlTransient
        public Integer getPageSize() {
            return pageSize;
        }

        public void setPageSize(Integer pageSize) {
            this.pageSize = pageSize;
        }
    }
}
